<?php
if($_tpl['total']){
	$str = '<div class="pagination"><ul>';
  	if(!$_tpl['prepg']){
  		$str .= '<li class="disabled"><a href="#">«</a></li>';
	}else{
		$str .= '<li><a href="'.$_tpl['prepg'].'">«</a></li>';
	}
	if($_tpl['pages']){
		foreach ($_tpl['pages'] as $v) {
			$class = $_tpl['currpage'] == $v['page'] ? ' class="active"' : '';
			$str .= "<li{$class}><a href=\"{$v['url']}\">{$v['page']}</a>";
		}
	}
	if($_tpl['currpage'] >= $_tpl['total']){
  		$str .= '<li class="disabled"><a href="#">»</a></li>';
	}else{
		$str .= '<li><a href="'.$_tpl['nextpg'].'">»</a></li>';
	}
	$str .= '</ul></div>';
	echo $str;
}